package cn.itcast.dubbo.service.impl;

import cn.itcast.dubbo.mapper.EmpMapper;
import cn.itcast.dubbo.pojo.Employee;
import cn.itcast.dubbo.pojo.PageInfo;
import cn.itcast.dubbo.service.EmpService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;

/**
 * @author Hujf
 * @title: EmpServiceImpl
 * @description: TODO
 * @date 2020/7/22 0022下午 12:17
 */
@Service(version = "${dubbo.service.version}")
public class EmpServiceImpl implements EmpService {
    @Resource
    private EmpMapper empMapper;

    @Override
    public int addEmp(Employee employee) {
        return 0;
    }

    @Override
    public int delEmp(String id) {
        return 0;
    }

    @Override
    public int updateEmp(Employee employee) {
        return 0;
    }

    @Override
    public PageInfo<Employee> findAll(PageInfo<Employee> info, String name) {
        return null;
    }

    @Override
    public Employee findEmpByCondition(Employee employee) {
        if (!StringUtils.isEmpty(employee.getPassword())) {
            employee.setPassword(employee.getPassword());
        }
        return empMapper.findEmpByCondition(employee);
    }
}
